//判断大小端
#include <stdio.h>

int Is_Small_Un()
{
    union Un
    {
        char a;
        int b;
    }test;
    test.b = 1;
    return test.a;
}

int Is_Small()
{
    int a = 1;
    char* p = (char*)&a;
    return *p;
}

int main()
{
    if(Is_Small_Un())
    printf("小端\n");
    else
    printf("大端\n");
    return 0;
}